
/* Generated by Interface Builder */

#import "MyView.h"
#import <appkit/Control.h>
#import <dpsclient/wraps.h>

@implementation MyView
 
+newFrame:(const NXRect *)tF {
    self = [super newFrame:tF];
    originX = 50.0;
    originY = 100.0;
    scaleX = 1.0;
    scaleY = 1.0;
    backgroundGray = 1.0;
    lineGray = 0.0;
    lineWidth = 10.0;
    rotation = 0.0;
    destinationX = 400.0;
    destinationY = 500.0;
    return self;
}

- lineGray:sender
{
   lineGray = [sender floatValue];
   [self display];
   return self;
}

- originX:sender
{
   originX = [sender floatValue];
   [self display];
   return self;
}

- originY:sender
{
   originY = [sender floatValue];
   [self display];
   return self;
}

- scaleX:sender
{
   scaleX = [sender floatValue];
   [self display];
   return self;
}

- scaleY:sender
{
   scaleY = [sender floatValue];
   [self display];
    return self;
}

- backgroundGray:sender
{
   backgroundGray = [sender floatValue];
   [self display];
   return self;
}

- lineWidth:sender
{
   lineWidth = [sender floatValue];
   [self display];
   return self;
}

- rotation:sender
{
   rotation = [sender floatValue];
   [self display];
   return self;
}

- destinationY:sender
{
   destinationY = [sender floatValue];
   [self display];
   return self;
}

- destinationX:sender
{
   destinationX = [sender floatValue];
   [self display];
   return self;
}

- drawSelf:(NXRect*)r :(int)c
{
    // printf("bg = %f  sX = %f sY= %f lG = %f lW = %f oX = %f oY = %f dX = %f dY = %f\n", backgroundGray, scaleX, scaleY, lineGray, lineWidth, originX, originY, destinationX, destinationY);
    PSsetgray(backgroundGray);
    NXRectFill(r);
    PSscale(scaleX, scaleY);
    PSrotate(rotation);
    PSsetgray(lineGray);
    PSsetlinewidth(lineWidth);
    PSnewpath();
    PSmoveto(originX, originY);
    PSlineto(destinationX, destinationY);
    PSstroke();
    return self;
}

@end
